[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Adds a new key-value pair to the dictionary.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
public virtual void Add( TKey key, TValue value ) |
Visual Basic (Declaration) |
---|
Public Overridable Sub Add ( _ key As TKey, _ value As TValue _ ) |
Visual C++ |
---|
public: virtual void Add ( TKey key, TValue value ) |
Parameters
- key
- TKey
Key to add.
- value
- TValue
Value to associated with the key.
Remarks
The default implementation of this method
checks to see if the key already exists using
ContainsKey, then calls the indexer setter if the key doesn't
already exist.
Exceptions
Exception | Condition |
---|---|
System..::ArgumentException | key is already present in the dictionary |
See Also
Wintellect.PowerCollections Namespace